Carbon


DrawChar

Header: QuickdrawText.h Carbon status: Supported

Draws the glyph for a single 1-byte character at the current pen location in the current graphics port.

void DrawChar (
    CharParameter ch
);
Parameter descriptions
ch

The character code whose glyph is to be drawn.

DISCUSSION

The DrawChar function draws a single character’s glyph and then advances the pen by the width of the glyph. If the glyph isn’t in the font, the font’s missing symbol is drawn.

If you’re drawing more than one character, it’s faster to make one DrawString or DrawText call rather than a series of DrawChar calls.

Because it takes a single-byte value as the ch parameter, DrawChar works only for 1-byte script systems. If you want to draw the glyph of a single character in a 2-byte script, call either DrawText, DrawString, or DrawJustified.

A series of calls to DrawChar in a 1-byte complex script system can give incorrect results because a text string is not always a simple concatenation of a series of characters. In a contextual script, two different glyphs may be used to represent a single character in its contextual form and alone. To draw a sequence of text in a 1-byte complex script system, use DrawText, DrawString, or DrawJustified instead.

For 1-byte complex scripts, you can use DrawChar for special purposes, such as to include the isolated glyph of a character in a book’s index, for example, to show a single glyph as it exists apart from contextual transformations.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)